          <?php $errorCategory = Yii::app()->user->hasFlash('errorCategory') ? unserialize(Yii::app()->user->getFlash('errorCategory')) : null ?>
          <!-- START OF MAINCOL -->
          <div class="MainCol CategoriesPage">

              <h1 class="left">编辑心理测试分类</h1>
              <div class="right">
              </div>
              <br class="clear" />
              
              <span class="NormalFont SmallFont">
                  <?= CHtml::image(Yii::app()->baseUrl.'/images/home_icon.gif', '主页'); ?> > 心理测试管理 > 编辑心理测试分类
               </span><br /><br />
              
              <?php if(Yii::app()->user->hasFlash('successMessage')) : ?>
              <div class="SuccessfulBox Smallbox">
                <span class="Successful"> <?php echo Yii::app()->user->getFlash('successMessage'); ?></span>
              </div>
              <?php endif ?>

              <div class="DisplayBox_top Smallbox">
              
              	  <b class="left SmallFont">共 <span class="Blue"><?= count($categories); ?></span> 条记录 </b>
                  
                  <div class="clear"><!-- DON'T DELETE --></div>      
              </div>
              
              <ul class="Lists Smallbox">
                  <li class="Yellow_bg">
                        <b class="BigFont">添加新分类</b><br /><br />
                        <?php if($errorCategory !== null) : ?>
                        <?php echo CHtml::errorSummary($errorCategory); ?>
                        <?php endif ?>

                        <?php echo CHtml::form(array('/admin/psytest/addcategory')) ?>
                        <div class="Smallbox">
                            <label>名称<span class="Red">*</span></label><?php echo CHtml::activeTextfield($_category, 'categoryName', array('class' => 'TxtInput')) ?>
                        </div>

                        <div class="Smallbox">
                            <label>排序<span class="Red">*</span></label><?php echo CHtml::activeTextfield($_category, 'categoryOrder', array('class' => 'TxtInput')) ?>
                        </div>

                        <div class="Dotted Midbox"><!-- DON'T DELETE --></div><br class="clear" />

                        <label>&nbsp;</label>
                            <?php echo CHtml::submitButton('提交') ?>
                        <br class="clear" />
                        <?php echo CHtml::endForm() ?>

                        </li>
                      <?php foreach($categories as $category) : ?>
                      <li class="ThinGrey_bg">
                         <b class="left icon_big"><?= $category->categoryOrder; ?>.</b>
                       	 <b class="left"><?= $category->categoryName; ?></b>
                       </span>
                       
                       <span class="right">
                      	<?= CHtml::link(CHtml::image(Yii::app()->baseUrl.'/images/edit_btn.gif', 'edit', array('class' => 'icon_biger')), array('/admin/psytest/editcategory', 'id' => $category->psyTestCategoryId)); ?>
                          <?php echo CHtml::link('&nbsp;', array('/admin/psytest/deletecategory', 'id' => $category->psyTestCategoryId), array('style' => 'margin-top: -18px;', 'class' => 'Delete', 'confirm' => '确定要删除该心理测试分类吗？')) ?>
                      </span>
                      <br class="clear" />
                      
                  </li>
                  <?php endforeach; ?>
                  
              </ul>
              
              
              <div class="DisplayBox_btm">
              
              	  <b class="left SmallFont">共 <span class="Blue"><?= count($categories); ?></span> 条记录 </b>
                  
                  <br class="clear" />
              </div>
              
        </div>
          <!-- END OF MAINCOL -->
